package com.jackson.engineeringtechnologyguide.event.inner;

/*
 * Author: JacksonCoder
 * FileName: SpringInnerEventListener
 * Version: 1.0.0
 * Date: 2025/1/11
 */

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 内置事件监听器
 */

@Slf4j
@Component
public class SpringInnerEventListener {

    @EventListener
    public void handlerContextRefresh(ContextRefreshedEvent event) {
        log.info("SpringInnerEventListener 接收到 ContextRefreshedEvent 事件");
    }

    @EventListener
    public void handlerContextClose(ContextClosedEvent event) {
        log.info("SpringInnerEventListener 接收到 ContextClosedEvent 事件");
    }

    @EventListener
    public void handleApplicationReady(ApplicationReadyEvent event) {
        log.info("SpringInnerEventListener 接收到 ApplicationReadyEvent 事件");
    }

}
